package com.sebarmeli.pages;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.ui.ExpectedConditions;
public class FoundOnImdbPage extends Page{
	public FoundOnImdbPage (PageManager pages)
	{
		super(pages);
	}
	
	@FindBy(xpath="//div[@class=\"content\"]//td[@class=\"title known\"]/a")
	private WebElement titanic;
	
	@FindBy(xpath="//h3")
	private WebElement results_from_imdb;
	
	public FoundOnImdbPage ensurePageLoaded()
	{	
		super.ensurePageLoaded();
        wait.until(ExpectedConditions.textToBePresentInElement(results_from_imdb, "Results from IMDb"));
		return this;
	}
	public AddFilmPage SelectFromFound()
	{
		titanic.click();
		return pages.addFilmPage;
	}
}